home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
systems
/
mac
/
oztex-german
/
OzTeX-1.4d.sit.bin
/
OzTeX 1.4
/
PS-files
/
TEXTtoPS.ps
< prev
next >
Wrap
Text File
|
1992-01-15
|
6KB
|
181 lines
%!
% This is the prolog used by OzTeX to print a Macintosh text file.
% Every character after this file will be treated as a printing character
% (or control character) instead of being interpreted as PostScript.
% Feel free to change the following parameters:
/tabwidth 3 def % tab setting
/maxline 66 def % maximum lines per page
/interline -11 def % baseline skip
/ptsize 10 def % point size for text
/setlocation
{ 72 0 translate % 1in left margin
0 764 moveto % start of top line; assumes A4 paper
/line 0 def % initialize line counter
/char 0 def % initialize char counter
} bind def
% The following table comes from Inside Mac I-221:
%
% 0 1 2 3 4 5 6 7 8 9 A B C D E F
% 0 | | | |0|@|P|`|p|Ç|É|á|░|└|╨| | |
% 1 | | |!|1|A|Q|a|q|ü|æ|í|▒|┴|╤| | |
% 2 | | |"|2|B|R|b|r|é|Æ|ó|▓|┬|╥| | |
% 3 | | |#|3|C|S|c|s|â|ô|ú|│|├|╙| | |
% 4 | | |$|4|D|T|d|t|ä|ö|ñ|┤|─|╘| | |
% 5 | | |%|5|E|U|e|u|à|ò|Ñ|╡|┼|╒| | |
% 6 | | |&|6|F|V|f|v|å|û|ª|╢|╞|╓| | |
% 7 | | |'|7|G|W|g|w|ç|ù|º|╖|╟|╫| | |
% 8 | | |(|8|H|X|h|x|ê|ÿ|¿|╕|╚|╪| | |
% 9 | | |)|9|I|Y|i|y|ë|Ö|⌐|╣|╔| | | |
% A | | |*|:|J|Z|j|z|è|Ü|¬|║|╩| | | |
% B | | |+|;|K|[|k|{|ï|¢|½|╗|╦| | | |
% C | | |,|<|L|\|l|||î|£|¼|╝|╠| | | |
% D | | |-|=|M|]|m|}|ì|¥|¡|╜|═| | | |
% E | | |.|>|N|^|n|~|Ä|₧|«|╛|╬| | | |
% F | | |/|?|O|_|o| |Å|ƒ|»|┐|╧| | | |
%
% To print all these characters we need to create an encoding vector
% better suited to a Macintosh text font:
/macvec 256 array def
/NUL/SOH/STX/ETX/EOT/ENQ/ACK/BEL/BS/HT/LF/VT/FF/CR/SO/SI
/DLE/DC1/DC2/DC3/DC4/NAK/SYN/ETB/CAN/EM/SUB/ESC/FS/GS/RS/US
macvec 0 32 getinterval astore pop
macvec 32 /Courier findfont /Encoding get 32 96 getinterval putinterval
macvec dup 39 /quotesingle put 96 /grave put
/Adieresis/Aring/Ccedilla/Eacute
/Ntilde/Odieresis/Udieresis/aacute
/agrave/acircumflex/adieresis/atilde
/aring/ccedilla/eacute/egrave
/ecircumflex/edieresis/iacute/igrave
/icircumflex/idieresis/ntilde/oacute
/ograve/ocircumflex/odieresis/otilde
/uacute/ugrave/ucircumflex/udieresis
/dagger/degree/cent/sterling
/section/bullet/paragraph/germandbls
/registered/copyright/trademark/acute
/dieresis/notequal/AE/Oslash
/infinity/plusminus/lessequal/greaterequal
/yen/mu/partialdiff/summation
/product/pi/integral/ordfeminine
/ordmasculine/Omega/ae/oslash
/questiondown/exclamdown/logicalnot/radical
/florin/approxequal/Delta/guillemotleft
/guillemotright/ellipsis/space/Agrave
/Atilde/Otilde/OE/oe
/endash/emdash/quotedblleft/quotedblright
/quoteleft/quoteright/divide/lozenge
/ydieresis/Ydieresis/fraction/currency
/guilsinglleft/guilsinglright/fi/fl
/daggerdbl/periodcentered/quotesinglbase/quotedblbase
/perthousand/Acircumflex/Ecircumflex/Aacute
/Edieresis/Egrave/Iacute/Icircumflex
/Idieresis/Igrave/Oacute/Ocircumflex
/apple/Ograve/Uacute/Ucircumflex
/Ugrave/dotlessi/circumflex/tilde
/macron/breve/dotaccent/ring
/cedilla/hungarumlaut/ogonek/caron
macvec 128 128 getinterval astore pop
% Note that /AE /ae /OE /oe don't exist in early model LaserWriters.
% /Courier findfont /CharStrings get { pop == (\r) print flush } forall
% We could do something about this but it isn't worth the effort.
% Create a copy of Courier but use the above encoding vector:
/Courier findfont
dup length dict /newdict exch def
{ 1 index /FID ne
{ newdict 3 1 roll put }
{ pop pop }
ifelse
} forall
newdict /Encoding macvec put
/NewCourier newdict definefont ptsize scalefont setfont
% Associate every possible character code with a default procedure:
/charprocs [ 256 {/showchar cvx} repeat ] def
/showchar
{ currentchar 0 thischar put % put thischar into 1-char string
/char char 1 add def % increment char counter
currentchar show
} bind def
% We have to switch to Symbol font for some characters
% (which look better if we slightly reduce their point size):
/symfont /Symbol findfont ptsize 1 sub scalefont def
/symshow
{ gsave symfont setfont show grestore
( ) show /char char 1 add def
} bind def
% See Adobe's red book, p.256--57 for following octal values:
charprocs 161 { (\260) symshow } put % /degree
charprocs 168 { (\342) symshow } put % /registered
charprocs 169 { (\343) symshow } put % /copyright
charprocs 170 { (\344) symshow } put % /trademark
charprocs 173 { (\271) symshow } put % /notequal
charprocs 176 { (\245) symshow } put % /infinity
charprocs 177 { (\261) symshow } put % /plusminus
charprocs 178 { (\243) symshow } put % /lessequal
charprocs 179 { (\263) symshow } put % /greaterequal
charprocs 181 { (\155) symshow } put % /mu
charprocs 182 { (\266) symshow } put % /partialdiff
charprocs 183 { (\123) symshow } put % /Sigma
charprocs 184 { (\120) symshow } put % /Pi
charprocs 185 { (\160) symshow } put % /pi
charprocs 186 { (\362) symshow } put % /integral
charprocs 189 { (\127) symshow } put % /Omega
charprocs 194 { (\330) symshow } put % /logicalnot
charprocs 195 { (\326) symshow } put % /radical
charprocs 197 { (\273) symshow } put % /approxequal
charprocs 198 { (\104) symshow } put % /Delta
charprocs 214 { (\270) symshow } put % /divide
charprocs 215 { (\340) symshow } put % /lozenge
% Some control characters need to be handled differently:
charprocs 9 /TAB cvx put
charprocs 12 /FF cvx put
charprocs 13 /CR cvx put
/TAB
{ { ( ) show /char char 1 add def
char tabwidth mod 0 eq { exit } if
} loop
} bind def
/FF
{ line 0 gt { showpage setlocation } if
} bind def
/CR % called when eol seen
{ /char 0 def % reset char counter
/line line 1 add def % increment line counter
line maxline eq % line = max lines per page?
{ FF } % if so, show page
{ currentpoint pop neg interline rmoveto } % else start next line
ifelse
} bind def
/currentchar 1 string def
setlocation
/charloop
{ { currentfile read not {exit} if % get next char; exit if no more
/thischar exch def % thischar is used in showchar
charprocs thischar get exec % execute appropriate procedure
} loop
line 0 gt { showpage } if % flush last page if necessary
} def
charloop